package com.ruoyi.expert.service.impl;

import com.ruoyi.common.utils.DateUtils;

import com.ruoyi.expert.domain.ExpertQuality;
import com.ruoyi.expert.mapper.ExpertQualityMapper;
import com.ruoyi.expert.service.IExpertQualityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 种苗质量标准Service业务层处理
 *
 * @author ruoyi
 * @date 2022-03-10
 */
@Service
public class ExpertQualityServiceImpl implements IExpertQualityService
{
    @Autowired
    private ExpertQualityMapper expertQualityMapper;

    /**
     * 查询种苗质量标准
     *
     * @param expertdbId 种苗质量标准主键
     * @return 种苗质量标准
     */
    @Override
    public ExpertQuality selectExpertQualityByExpertdbId(Long expertdbId)
    {
        return expertQualityMapper.selectExpertQualityByExpertdbId(expertdbId);
    }

    /**
     * 查询种苗质量标准列表
     *
     * @param expertQuality 种苗质量标准
     * @return 种苗质量标准
     */
    @Override
    public List<ExpertQuality> selectExpertQualityList(ExpertQuality expertQuality)
    {
        return expertQualityMapper.selectExpertQualityList(expertQuality);
    }

    /**
     * 新增种苗质量标准
     *
     * @param expertQuality 种苗质量标准
     * @return 结果
     */
    @Override
    public int insertExpertQuality(ExpertQuality expertQuality)
    {
        expertQuality.setCreateTime(DateUtils.getNowDate());
        return expertQualityMapper.insertExpertQuality(expertQuality);
    }

    /**
     * 修改种苗质量标准
     *
     * @param expertQuality 种苗质量标准
     * @return 结果
     */
    @Override
    public int updateExpertQuality(ExpertQuality expertQuality)
    {
        expertQuality.setUpdateTime(DateUtils.getNowDate());
        return expertQualityMapper.updateExpertQuality(expertQuality);
    }

    /**
     * 批量删除种苗质量标准
     *
     * @param expertdbIds 需要删除的种苗质量标准主键
     * @return 结果
     */
    @Override
    public int deleteExpertQualityByExpertdbIds(Long[] expertdbIds)
    {
        return expertQualityMapper.deleteExpertQualityByExpertdbIds(expertdbIds);
    }

    /**
     * 删除种苗质量标准信息
     *
     * @param expertdbId 种苗质量标准主键
     * @return 结果
     */
    @Override
    public int deleteExpertQualityByExpertdbId(Long expertdbId)
    {
        return expertQualityMapper.deleteExpertQualityByExpertdbId(expertdbId);
    }
}
